Skip to content

Conversation

@Devon-White
Copy link
Contributor

@Devon-White Devon-White commented Oct 31, 2025

Description

This PR adds support for explicitly disabling info page generation by setting createInfoPageMD: false in the markdownGenerators configuration.

Changes

  • Type System: Updated MarkdownGenerator interface to allow createInfoPageMD to be boolean in addition to a function
  • Validation: Modified Joi schema to accept boolean as a valid value for createInfoPageMD
  • Page Generation Logic: Added check in openapi.ts to skip info page creation when createInfoPageMD is explicitly set to false
  • Generator Resolution: Updated index.ts to properly handle boolean values - when true or undefined, use default generator; when false, skip generation; when function, use custom generator
  • Documentation: Updated README to document the new behavior
  • Demo: Added example usage in the demo configuration

Expected Behavior

When createInfoPageMD is set in markdownGenerators:

  • false → Info pages (.info.mdx files) will not be generated
  • true → Explicitly enable info pages with default generator (same as undefined)
  • function → Use custom generator function
  • undefined (not set) → Use default generator

Usage Example

markdownGenerators: {
  createApiPageMD: myCustomApiMdGenerator,
  createInfoPageMD: false, // Explicitly disable info page generation
}

Or to explicitly enable with default:

markdownGenerators: {
  createInfoPageMD: true, // Explicitly enable with default generator
}

Edge Cases Handled

  • When createInfoPageMD: false and categoryLinkSource: "info" are both set, categories gracefully degrade to spindown behavior (collapsible folders without links)
  • The infoTemplate option has no effect when info page generation is disabled
  • All other page types (API, tag, schema) continue to work normally
  • API endpoint pages and other page types continue to generate normally regardless of info page setting

Motivation and Context

Solves: #1103

How Has This Been Tested?

Locally tested. Enabled setting on different specs on & off and observed the info page not being generated. We have also tested the edge case described above when categoryLinkSource is set to info.

Additional notes: We could potentially add custom validation to fail build when category source is set to info and info pages are disabled.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@Devon-White Devon-White changed the title Add ability to turn of info page generation Add ability to turn off info page generation Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants